# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=ocrmypdf
pkgver=10.3.1
pkgrel=0
pkgdesc="Add OCR text layer to scanned PDF files"
url="https://github.com/jbarlow83/OCRmyPDF"
arch="noarch"
license="MIT"
options="!check" # failing tests with jbig2enc 0.17
depends="
	python3
	py3-setuptools
	py3-reportlab
	py3-chardet
	py3-cffi
	py3-img2pdf
	py3-pdfminer
	py3-pikepdf
	py3-pillow
	py3-tqdm

	tesseract-ocr
	ghostscript
	unpaper
	qpdf
	jbig2enc
	pngquant
	leptonica
	"
makedepends="python3-dev"
source="https://files.pythonhosted.org/packages/source/o/ocrmypdf/ocrmypdf-$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="121ff2ec36ed38f91506aafb50f22a4c3c7710c82b43dc3d106b84b8223f38a90b438abb0d607647b0bf3c663d5d01d8bae85eab9e09f31b7fd37052e5739afd  ocrmypdf-10.3.1.tar.gz"
